package com.cjjd.c.feature.home.chekin.pay;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebView;

import com.cjjd.c.EventBusKeys;
import com.cjjd.c.R;
import com.cjjd.c.ShareKeys;
import com.cjjd.c.base.ActionBarActivity;
import com.cjjd.c.feature.dialog.TextDialog;
import com.cjjd.c.http.Url;
import com.cjjd.c.utils.LogUtil;
import com.cjjd.c.utils.SharePrefUtil;

import org.greenrobot.eventbus.EventBus;

import butterknife.Bind;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * ----------------------------------
 * Created by xyd on 2017/9/26.
 * <p/>
 * 描  述：
 * <p/>
 * 修订历史:
 * ----------------------------------
 */

public class PaySuccessedActivity extends ActionBarActivity {


//    @Bind(R.id.webView)
//    WebView webView;

    @Override
    public Object getTitleString() {
        return "选房成功";
    }

    @Override
    public void onBackPressed() {
//        super.onBackPressed();
        EventBus.getDefault().post(EventBusKeys.hadPayCheckIn);
        finish();
    }


    @Override
    public int getContentView() {
        return R.layout.fragment_pay_success;
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ButterKnife.bind(this);
        mActionBar.getLeftButton().setVisibility(View.INVISIBLE);

//        new TextDialog(mContext, "支付成功，请前往前台办理领取房卡", new TextDialog.OnCloseListener() {
//            @Override
//            public void OnClick() {
//
//            }
//        }).show();

//        LogUtil.e("xyd"," 加载的h5 地址是 " + Url.HOST_BASE + "/h5/index.html?orderUuid=" + SharePrefUtil.getString(mContext, ShareKeys.payOrderId)+"&token="+SharePrefUtil.getString(mContext,ShareKeys.Token)+"&sessionId="+SharePrefUtil.getString(mContext
//                ,ShareKeys.sessionId));
//        //支持js
//        webView.getSettings().setJavaScriptEnabled(true);
//        webView.loadUrl(Url.HOST_BASE + "/h5/index.html?orderUuid=" + SharePrefUtil.getString(mContext, ShareKeys.payOrderId)+"&token="+SharePrefUtil.getString(mContext,ShareKeys.Token)+"&sessionId="+SharePrefUtil.getString(mContext
//        ,ShareKeys.sessionId));
    }


    @Override
    protected void onDestroy() {
        super.onDestroy();
        ButterKnife.unbind(this);
    }

    @OnClick(R.id.btn_next)
    public void onViewClicked() {

        EventBus.getDefault().post(EventBusKeys.hadPayCheckIn);
        finish();

    }

}
